﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PopupSearchStaff.aspx.cs"
    Inherits="MTRC.ODMS.Web.SOM.Popup.PopupSearchStaff" %>

<%@ Register Assembly="APJ.Web.UI.WebControls" Namespace="APJ.Web.UI.WebControls"
    TagPrefix="APJ" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Disposal Case Detail</title>
    <base target="_self" />
    <meta http-equiv="Expires" content="0" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <link href="<%=ResolveUrl("~/CSS/common.css")%>" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Javascript/CommonFunction.js"></script>
    <script type="text/jscript">
        var pageID;
        function setStaffInfor(StaffID, StaffName, DepartmentCompany, OrganizationUnit, ContactNo, StaffType, StaffOrExtPartyID, EventPersonType, StaffTypeDesc, ExtPartyID, ExtPartyStaffSnapShotID) {
            //debugger;
            pageID = getQueryString("PageID");
            //---------Add by Nearly for Asset Loan Enquiry Begin-------- 
            if (pageID == "AssetLoanEnquiry") {
                window.dialogArguments.form1.txtStaffID.value = StaffID;
                window.dialogArguments.form1.txtStaffName.value = StaffName;
                window.dialogArguments.form1.txtDepartmentCompany.value = DepartmentCompany;
                window.close();
            }
            //---------Add by Nearly for Asset Loan Enquiry End----------- 
            else if (pageID == "ExternalStaffSnapEntry") {
                window.dialogArguments.form1.hdnStaffInfoID.value = StaffOrExtPartyID;
                window.dialogArguments.form1.txtStaffInfoID.value = StaffName;
                window.dialogArguments.form1.hdnStaffName.value = StaffName;
                window.close();
            }
            else if (pageID == "AL") {
                //--added by huangyao
                //                    window.dialogArguments.form1.txtStaffID.value=StaffID;
                //                    window.dialogArguments.form1.txtStaffName.value=StaffName;
                //                    window.dialogArguments.form1.txtDepartmentCompany.value=DepartmentCompany;
                //                    window.dialogArguments.form1.txtOrganizationUnit.value=OrganizationUnit;
                //                    window.dialogArguments.form1.txtContactNo.value=ContactNo;
                //                    window.dialogArguments.form1.hdnStaffType.value=StaffType;
                //                    window.dialogArguments.form1.hdnImgStaffTypeTooltip.value=EventPersonType;
                //                    //debugger;
                //                    window.dialogArguments.form1.hdnStaffOrExtPartyID.value=StaffOrExtPartyID;
                //                    //debugger;
                //                    window.dialogArguments.form1.imgStaffType.title = EventPersonType;
                window.dialogArguments.form1.ucAssetLoan_txtStaffID.value = StaffID;
                window.dialogArguments.form1.ucAssetLoan_txtStaffName.value = StaffName;
                window.dialogArguments.form1.ucAssetLoan_txtDepartmentCompany.value = DepartmentCompany;
                window.dialogArguments.form1.ucAssetLoan_txtOrganizationUnit.value = OrganizationUnit;
                window.dialogArguments.form1.ucAssetLoan_txtContactNo.value = ContactNo;
                window.dialogArguments.form1.ucAssetLoan_hdnStaffType.value = StaffType;
                window.dialogArguments.form1.ucAssetLoan_hdnImgStaffTypeTooltip.value = EventPersonType;
                //debugger;
                window.dialogArguments.form1.ucAssetLoan_hdnStaffOrExtPartyID.value = StaffOrExtPartyID;
                //debugger;
                window.dialogArguments.form1.ucAssetLoan_imgStaffType.title = EventPersonType;
                window.dialogArguments.form1.ucAssetLoan_hdnExtPartyStaffSnapShotID.value = ExtPartyStaffSnapShotID; //----huangyao 20090105 change 0824
                window.close();
            }
            else if (pageID == "ResponsibilityTransfer") {
                //--added by Jensen 2008-09-10 for Responsibility Transfer
                window.dialogArguments.form1.txtStaffID.value = StaffID;
                window.dialogArguments.form1.txtStaffName.value = StaffName;
                window.dialogArguments.form1.txtDepartmentCompany.value = DepartmentCompany;
                window.dialogArguments.form1.txtOrganizationUnit.value = OrganizationUnit;
                window.dialogArguments.form1.txtContactNo.value = ContactNo; //Comment by jack 20150826 for u170.4
                window.dialogArguments.form1.hdnStaffType.value = StaffType;
                window.dialogArguments.form1.hdnExtPartyStaffSnapShotID.value = ExtPartyStaffSnapShotID; //add by hzx 20090104                  
                //---------commentted by huangyao 20090107
                //                    var pForm = window.dialogArguments.form1;
                //                    window.dialogArguments.__doPostBack(pForm.hdnStaffType.id, "");                
                //------end---commentted by huangyao 20090107
                window.close();
            }

            else if (pageID == "FireProtectionEntryRequestBy")//------------Add by Zeng shunbo 2008-09-10 11:26---------------
            {
                window.dialogArguments.form1.UCFirePortection1_txtRequestByID.value = StaffID;
                window.dialogArguments.form1.UCFirePortection1_txtRequestByName.value = StaffName;
                window.dialogArguments.form1.UCFirePortection1_txtRequestByDept.value = DepartmentCompany;
                window.dialogArguments.form1.UCFirePortection1_txtRequestByOU.value = OrganizationUnit;
                window.dialogArguments.form1.UCFirePortection1_txtRequestByContactNumber.value = ContactNo;
                window.dialogArguments.form1.UCFirePortection1$hdnStaffType.value = StaffType;
                window.dialogArguments.form1.UCFirePortection1$hdnRequestStaffOrExtPartyID.value = StaffOrExtPartyID;
                window.dialogArguments.form1.UCFirePortection1$hdnExtPartyStaffSnapShotID.value = ExtPartyStaffSnapShotID; //add by zengshunbo 2009-01-06
                window.close();
            }
            else if (pageID == "FireProtectionEntryResponsibleBy")//------------Add by Zeng shunbo 2008-09-10 11:26---------------
            {
                window.dialogArguments.form1.UCFirePortection1$hdnResponsibleByID.value = StaffID;
                window.dialogArguments.form1.UCFirePortection1_txtResponsibleBy.value = StaffName;
                window.dialogArguments.form1.UCFirePortection1$hdnResponsibleByType.value = StaffType;
                window.dialogArguments.form1.UCFirePortection1$hdnResponsibleStaffOrExtPartyID.value = StaffOrExtPartyID;
                window.close();
            }
            else if (pageID == "AdmissionRegistryEntry")//---------------------Add by hezhixiang 2008-09-10
            {
                window.dialogArguments.form1.txtStaffID.value = StaffID;

                window.dialogArguments.form1.hdnStaffName.value = StaffName;
                window.dialogArguments.form1.txtStaffName.value = StaffName;

                window.dialogArguments.form1.hdnDepartmentCompany.value = DepartmentCompany;
                window.dialogArguments.form1.txtDepartmentCompany.value = DepartmentCompany

                window.dialogArguments.form1.hdnOrganizationUnit.value = OrganizationUnit;
                window.dialogArguments.form1.txtOrganizationUnit.value = OrganizationUnit

                window.dialogArguments.form1.hdnStaffType.value = StaffType;

                window.dialogArguments.form1.hdnStaffOrExtPartyID.value = StaffOrExtPartyID;

                window.dialogArguments.form1.hdnExtPartyStaffSnapShotID.value = ExtPartyStaffSnapShotID; //add by hzx 20090104

                window.dialogArguments.form1.txtContactNo.value = ContactNo; //Add By Gordon 20150703

                window.close();
            }
            //add by SQB
            else if (pageID == "GeneralEventEntry") {
                window.dialogArguments.form1.txtReportBy.value = StaffID;
                window.dialogArguments.form1.txtReportName.value = StaffName;
                window.dialogArguments.form1.hdnStaffType.value = StaffType;
                window.dialogArguments.form1.hdnStaffOrExtPartyID.value = StaffOrExtPartyID;
                window.dialogArguments.form1.hdnExtPartyStaffSnapShotID.value = ExtPartyStaffSnapShotID; //add by hzx 20090104

                if (StaffType == 1) {
                    window.dialogArguments.form1.imgStaffType.src = "../../Images/SOM/StaffType_Staff.gif"
                    window.dialogArguments.form1.imgStaffType.title = StaffTypeDesc;
                    window.dialogArguments.form1.txtReportName.disabled = true;
                }
                else if (StaffType == 2) {
                    window.dialogArguments.form1.imgStaffType.src = "../../Images/SOM/StaffType_CQAContractor.gif"
                    window.dialogArguments.form1.imgStaffType.title = StaffTypeDesc;
                    window.dialogArguments.form1.txtReportName.disabled = true;
                }
                else if (StaffType == 3) {
                    window.dialogArguments.form1.imgStaffType.src = "../../Images/SOM/StaffType_StationContractor.gif"
                    window.dialogArguments.form1.imgStaffType.title = StaffTypeDesc;
                    window.dialogArguments.form1.txtReportName.disabled = true;
                }
                else if (StaffType == 4) {
                    window.dialogArguments.form1.imgStaffType.src = "../../Images/SOM/StaffType_AddHoc.gif"
                    window.dialogArguments.form1.imgStaffType.title = StaffTypeDesc;
                }
                window.close();
            }
            else if (pageID == "StaffInjury") //Add by LiangZehong on 2008-10-27
            {
                window.dialogArguments.StaffInjury.ctl02_txt_ExtStaffID.value = StaffID;
                window.dialogArguments.StaffInjury.ctl02_hid_ExtPartyID.value = ExtPartyID;

                window.close();
            }
        }			
    </script>
</head>
<body style="width: auto;Width:740px;">
    <form id="form1" runat="server">
    <table cellpadding="0" cellspacing="0" width="100%">
        <tr>
            <td style="width: 1%" align="center" >
            </td>
            <td>
                <div style="width: 100%;">
                    <table cellpadding="1" cellspacing="1" width="710px" style="border-width: 1px; border-color: #AAAAAA;
                        border-style: solid; background-color: #eeeeee;">
                        <tr>
                            <td style="width: 15%">
                                <asp:Literal ID="lblStaffType" runat="server"></asp:Literal>
                            </td>
                            <td>
                                <asp:RadioButtonList ID="rblStaffType" runat="server" RepeatDirection="Horizontal">
                                </asp:RadioButtonList>
                            </td>
                        </tr>
                        <%--<tr>
				                    <td><asp:Literal ID="lblStaffID" Runat="server" ></asp:Literal></td>
				                    <td><asp:textbox id="txtStaffID" runat="server" EnableViewState="False" MaxLength="20"></asp:textbox></td>
			                    </tr>--%>
                        <tr>
                            <td>
                                <asp:Literal ID="lblStaffName" runat="server"></asp:Literal>
                            </td>
                            <td>
                                <asp:TextBox ID="txtStaffName" runat="server" EnableViewState="False" MaxLength="50"
                                    Width="219px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Literal ID="lblDepartmentCompany" runat="server"></asp:Literal>
                            </td>
                            <td>
                                <%--edit by dylan 20150827 for u168.1--%>
                                <%-- <asp:textbox id="txtDepartmentCompany" runat="server" EnableViewState="False" MaxLength="50"></asp:textbox><br />--%>
                                <asp:DropDownList ID="ddlDepartmentCompany" runat="server" Width="223px">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <%--<tr>
				                    <td><asp:Literal ID="lblContactNo" Runat="server" ></asp:Literal></td>
				                    <td><asp:textbox id="txtContactNo" runat="server" EnableViewState="False" MaxLength="50"></asp:textbox></td>
			                    </tr>
			                    <tr>
				                    <td><asp:Literal ID="lblEmail" Runat="server" ></asp:Literal></td>
				                    <td><asp:textbox id="txtEmail" runat="server" EnableViewState="False" MaxLength="70"></asp:textbox></td>
			                    </tr>--%>
                        <tr>
                            <td>
                                <input type="button" id="btnSearch" runat="server" value="Search" />
                                <input type="button" id="btnColse" runat="server" onclick="self.close()" />
                            </td>
                        </tr>
                    </table>
                    <br />
                    <div style="overflow-y:scroll; width: 710px; height: 360px;">
                        <table cellpadding="0" cellspacing="0" width="97.6%">
                            <tr>
                                <td>
                                    <APJ:CommonGridView ID="grdPopSearchStaff" runat="server" AllowPaging="True" DataKeyNames="CQAStaffID"
                                        AutoGenerateColumns="False" OnRowDataBound="grdPopSearchStaff_OnRowDataBound"
                                        BorderColor="black" CssClass="GridView" AllowSorting="True" AscPic="~/Images/Common/arrow_up_green.png"
                                        DescPic="~/Images/Common/arrow_down_green.png" Width="97.5%" PageLinkCount="7">
                                        <Columns>
                                            <asp:BoundField DataField="StaffID" HeaderText="SOM_SearchStaffID" SortExpression="StaffID">
                                            </asp:BoundField>
                                            <asp:BoundField DataField="StaffName" HeaderText="SOM_SearchStaffName" SortExpression="StaffName">
                                            </asp:BoundField>
                                            <asp:BoundField DataField="DepartmentCompany" HeaderText="SOM_ContractorCompany"
                                                SortExpression="DepartmentCompany"></asp:BoundField>
                                            <asp:BoundField DataField="OrganizationUnit" HeaderText="SOM_OrgUnit" SortExpression="OrganizationUnit"
                                                Visible="False"></asp:BoundField>
                                            <asp:BoundField DataField="Tel" HeaderText="COM_ContactNo" SortExpression="Tel" Visible="False">
                                            </asp:BoundField>
                                            <asp:BoundField DataField="EmailAddress" HeaderText="COM_Email" SortExpression="EmailAddress"
                                                Visible="False"></asp:BoundField>
                                            <asp:TemplateField Visible="False">
                                                <HeaderStyle BorderStyle="None" />
                                                <ItemTemplate>
                                                    <%# Eval("EventPersonType")%>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                        </Columns>
                                        <RowStyle CssClass="GridView_Row"></RowStyle>
                                        <HeaderStyle CssClass="GridView_Header"></HeaderStyle>
                                        <AlternatingRowStyle CssClass="GridView_AlternativeRow"></AlternatingRowStyle>
                                        <EmptyDataRowStyle CssClass="GridView_Header" />
                                        <PagerTemplate>
                                            <asp:Table ID="CommonPagerTemplate" runat="server" Width="100%">
                                                <asp:TableRow ID="COMGRIDV_TR" runat="server">
                                                    <asp:TableCell ID="COMGRIDV_Pager_Cell_TotalRecords" runat="server" CssClass="GridView_Pager_Cell_TotalRecords">
                                                        <asp:Label ID="Lbl_T_TotalRecords" runat="server">Total Records:</asp:Label>
                                                        <asp:Label ID="Lbl_V_TotalRecords" runat="server"></asp:Label>
                                                        &nbsp; &nbsp;
                                                        <asp:Label ID="Lbl_V_CurPage" runat="server"></asp:Label>
                                                        &nbsp;<asp:Label runat="server">/</asp:Label>
                                                        &nbsp;<asp:Label ID="Lbl_V_TotalPages" runat="server"></asp:Label>
                                                    </asp:TableCell>
                                                    <asp:TableCell ID="COMGRIDV_Pager_Cell_PageSize" runat="server" CssClass="GridView_Pager_Cell_PageSize">
                                                        <asp:Label ID="Lbl_T_PageSize" runat="server">PageSize:</asp:Label>
                                                        &nbsp;&nbsp;<asp:DropDownList ID="DDL_PageSize" runat="server" AutoPostBack="True">
                                                            <asp:ListItem Value="5">5</asp:ListItem>
                                                            <asp:ListItem Value="10">10</asp:ListItem>
                                                            <asp:ListItem Value="15">15</asp:ListItem>
                                                            <asp:ListItem Value="20">20</asp:ListItem>
                                                            <asp:ListItem Value="25">25</asp:ListItem>
                                                            <asp:ListItem Value="30">30</asp:ListItem>
                                                        </asp:DropDownList>
                                                    </asp:TableCell>
                                                    <asp:TableCell ID="COMGRIDV_Pager_Cell_Prev" runat="server" CssClass="GridView_Pager_Cell_Prev" >
                                                        <asp:LinkButton ID="LBtn_Previous" runat="server" CommandArgument="Prev" CommandName="Page"><</asp:LinkButton>
                                                    </asp:TableCell>
                                                    <asp:TableCell ID="COMGRIDV_Pager_Cell_PagerLink" runat="server" CssClass="GridView_Pager_Cell_PagerLink">
                                                        <asp:Panel ID="Pnl_PageLink" runat="server" CssClass="GridView_Pager_PageLinkPanel" >
                                                        </asp:Panel>
                                                    </asp:TableCell>
                                                    <asp:TableCell ID="COMGRIDV_Pager_Cell_Next" runat="server" CssClass="GridView_Pager_Cell_Next" >
                                                        <asp:LinkButton ID="LBtn_Next" runat="server" CommandArgument="Next" CommandName="Page">></asp:LinkButton>
                                                    </asp:TableCell>
                                                </asp:TableRow>
                                            </asp:Table>
                                        </PagerTemplate>
                                        <EmptyDataTemplate>
                                            <asp:Table runat="server" CssClass="GridView_Header_EmptyData">
                                                <asp:TableRow runat="server">
                                                    <asp:TableCell runat="server" Style="border-right: black 1px solid;"></asp:TableCell>
                                                    <asp:TableCell runat="server" Style="border-right: black 1px solid;"></asp:TableCell>
                                                    <asp:TableCell runat="server"></asp:TableCell>
                                                </asp:TableRow>
                                            </asp:Table>
                                        </EmptyDataTemplate>
                                    </APJ:CommonGridView>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </td>
            <td style="width: 1%">
            </td>
        </tr>
    </table>
    </form>
    <br />
</body>
</html>
